$(function(){
	//当失去焦点时
	$("#inputEmail3").blur(function(){
		var data = $(this).val();
		$.ajax({
			type:'post',
			async:false,
			url:"./ajax.php",
			data:{username:data},
			dataType:"json",
			success:function(result){
				if(result.error==1){
					$("#login_username").append('<span class="glyphicon glyphicon-ok" aria-hidden="true">用户名正确</span>');
				}else if(result.error==0){
					$("#login_username").append('<span class="glyphicon glyphicon-remove" aria-hidden="true">用户名不存在</span>');
				}
			},
			error: function (errorMsg) {
                   alert('信息返回错误') ;
                }


		})
	})
	//当聚焦时
	$("#inputEmail3").focus(function(event) {
		$("#login_username").empty();
	});

	})